import request from "@/utils/request";

// 查询附属品列表
export function listAccessories(query) {
  return request({
    url: "/admin/assets/accessories/",
    method: "get",
    params: query
  });
}

// 查询附属品详细
export function getAccessories(id) {
  return request({
    url: "/admin/assets/accessories/" + id + "/",
    method: "get"
  });
}

// 新增附属品
export function addAccessories(data) {
  return request({
    url: "/admin/assets/accessories/",
    method: "post",
    data: data
  });
}

// 修改附属品
export function updateAccessories(data) {
  return request({
    url: "/admin/assets/accessories/" + data.id + "/",
    method: "put",
    data: data
  });
}

// 删除附属品
export function delAccessories(id) {
  return request({
    url: "/admin/assets/accessories/" + id + "/",
    method: "delete"
  });
}

// 导出附属品
export function exportAccessories(query) {
  return request({
    url: "/admin/assets/accessories/export/",
    method: "get",
    params: query
  });
}

// 借出
export function accessoryCheckout(data) {
  return request({
    url: "/admin/assets/accessorycheckout/",
    method: "post",
    data: data
  });
}

// 归还
export function accessoryCheckin(data) {
  return request({
    url: "/admin/assets/accessorycheckin/",
    method: "post",
    data: data
  });
}

// 查询附属品的借还记录
export function accessoryRecords(query) {
  return request({
    url: "/admin/assets/accessoryrecords/",
    method: "get",
    params: query
  });
}

export function importsAccessories(data) {
  return request({
    url: "/admin/assets/accessories/import/",
    method: "post",
    data: data
  });
}
